{template Public:Page:header}
<form data-bv-feedbackicons-validating="glyphicon glyphicon-refresh" data-bv-feedbackicons-invalid="glyphicon glyphicon-remove" data-bv-feedbackicons-valid="glyphicon glyphicon-ok" class="form-horizontal bv-form" id="ShopForm" novalidate="novalidate">
             
<div class="container">
  <div class="row">
  
    {template Member:Index:sidebar}
    
    <div class="col-lg-10 well-col-pl-30">
      <div class="row">
            <div class="well">

                <h3>免费开店</h3>
               	<div class="row">
                      <div class="col-lg-12 col-sm-12 col-xs-12">
                        <div class="wizard wizard-wired">
                          <ul class="steps">
                            <li class="active" data-target="#wiredstep1"><span class="step">1</span><span class="title">填写店铺信息</span> <span class="chevron"></span></li>
                            <li data-target="#wiredstep2"><span class="step">2</span><span class="title">实名认证</span> <span class="chevron"></span></li>
                            <li data-target="#wiredstep3"><span class="step">3</span><span class="title">审核完成</span> <span class="chevron"></span></li>
                          </ul>
                        </div>
                      </div>
                </div>

        
            <br />
        <div class="row"> 
        <div class="col-lg-11 col-lg-offset-1">

          
                        
                <div class="row">
               
                     <h4>当前头像：</h4>          
       
           	 <p>
               {echo GetAvatarSimple($uid,120)}
               </p>
               <p>
               <a class="btn btn-primary btn-sm" href="/member/avatar">更新头像</a>
               </p>
         
      			</div>
                
                 <div class="row">
        
    
               <h4>店铺名称：</h4>
     			
                <div class="col-lg-4">
                 <div class="row">
             	<input type="text" name="shopname" value="{if !empty($member['shopname'])}{echo $member['shopname']}{/if}" class="form-control">
                </div>
                </div>
                </div>
        		<br>
               <div class="row">

           
                <h4>店铺分类：</h4>
    		 
              <div class="btn-group">
                            <a href="javascript:void(0);" class="btn btn-default" id="CategoryNanme">{if !empty($member['category_name_1'])}{if $member['category_name_3']}{echo $member['category_name_3']} > {/if}{echo $member['category_name_2']} > {echo $member['category_name_1']}{else}请选择分类{/if}</a>
                            <a href="javascript:void(0);" data-toggle="dropdown" class="btn btn-default  dropdown-toggle"><i class="fa fa-angle-down"></i></a>
                            <ul class="dropdown-menu" id="FuwuCategory" style="z-index:1001"></ul>
                  </div>
                  
                 
  
       </div>
       <br>
       

      	<div class="row">
            
                 <h4>所在地：</h4>
    			<script type="text/javascript" src="{echo AURL}/js/jquery_cityselect.js"></script>
            	<script type="text/javascript" src="{echo AURL}/js/foxphp_json_city.js"></script>
    
    	
                <div class="input-group" id="city_1">					  
                                <select class="prov"></select> 
                                <select class="city" disabled="disabled"></select>
                                <select class="dist" disabled="disabled"></select>
                </div>
    
                    
                            
            <script type="text/javascript">$(function(){$("#city_1").citySelect({prov:$("#ProvId").val(),city:$("#CityId").val(),dist:$("#DistId").val(),nodata:"none"});});</script>
            <input type="hidden" id="ProvId" name="provid" AUTOCOMPLETE="off"  value="{if !empty($member["provid"])}{echo $member["provid"]}{else}1{/if}">
            <input type="hidden" id="CityId" name="cityid" AUTOCOMPLETE="off" value="{if !empty($member["cityid"])}{echo $member["cityid"]}{else}37{/if}">
            <input type="hidden" id="DistId" name="distid" AUTOCOMPLETE="off"  value="{if !empty($member["distid"])}{echo $member["distid"]}{else}567{/if}">
            
        </div>  
             <br>
             </div>
             

             <div class="row">
               <div class="col-lg-11 col-lg-offset-1">
               	<button class="btn btn-success" type="submit">下一步</button>
               </div>
            </div>

          <input type="hidden" name="datatype" value="json"/>
          <input type="hidden" name="Submit" value="true"/>
          <input type="hidden" name="catid" id="Catid" value="{if !empty($member['catid'])}{echo $member['catid']}{/if}"/>
             
				</div>
               
            </div>
    </div>
  </div>
</div>
</div>

 </form>
<script src="{echo AURL}/js/validation/bootstrapValidator.js"></script>
<script>							
$(function(){
		SetFormCategory(AURL+"/js/foxphp_json_task_category.js",'#FuwuCategory');
		
 		  $('#ShopForm').bootstrapValidator({
                excluded: [':disabled'],
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
				fields: {
					shopname: {
						validators: {
							notEmpty: {
								message: '请输入店铺名称！'
							},
							stringLength: {
								min: 2,
								max: 30,
								message: '输入店铺名称最少2字符最多30字符！'
							}
						}
					}
				},
                submitHandler: function (form) {

					var catid=parseInt($("#Catid").val());
					if(catid<1){
						 bootbox.alert({ 
							size: 'small',
							message: "请选择店铺分类！"
						})
						 return false; 
					 }
					 
					 
					var distid=$("#DistId").val();
					if(distid<1){
						 bootbox.alert({ 
							size: 'small',
							message: "请选择地区分类！"
						})
						 return false; 
					 }
			
				  $.post('{echo U("/post/member/openshop")}',$("#ShopForm").serialize(), function(json) {
					
					  	$('.bootbox').PhpappProgress({json:json});

				 		return true;
					
				  }, 'json');
				  

				 bootbox.dialog({
					 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
					 title: '<i class="icon fa fa-retweet"></i> 提交中',
					 closeButton: false
				 }).PhpappProgress({time:2000});
			 
				  return false; 
	
                } 
				
			
            });
			
})
</script>
{template Public:Page:footer}